﻿/// <reference path="knockout-2.1.0.js" />

function PartialViewModel() {

    this.Something = "sdsdfsdfdsf";

}

function PageViewModel() {

    var self = this;

    this.PartialViewModel = new PartialViewModel();

    this.FirstName = ko.observable("Hintea");
    this.LastName = ko.observable("Dan");

    this.List = ko.observableArray(["Val1", "Val2", "Val3"]);

    this.FormattedName = ko.computed(function () {
        return self.FirstName() + " - " + self.LastName();
    });

    this.WriatbleComputed = ko.computed({
        read: function () {
            return self.FirstName() + " - " + self.LastName();
        },
        write: function (value) {
        }
    });

    this.OkClick = function (text) {
        self.List.push("Val4");
    }
}